﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="vtc" uri="/ls-trade-tags"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
<head>
	<title>Data Import - Create</title>
	
	<script type="text/javascript">
	
		$(document).ready(function() {
			$("#dataimportForm").validate({
				rules: {
					"dataimport.jobName": {
						required: true,
						maxlength:30
					},
					"dataimport.interfaceType": {
						required: true
					},
					"runAtDate": {
						required: true
					},
					"runAtHour": {
						required: true
					},
					"runAtMin": {
						required: true
					}
					
				}
			 });
		
	    });
	
		function clickBtn(action){
			if(action!=null && $.trim(action)!=""){
				$("#dataimportForm").attr('action',action);
			}
			
			$("#dataimportForm").submit();
		}
	</script>
           
</head>
<body>

<div class="content">
  <div class="pageTitle">Data Import - Create</div>
  
  <div class="form2">
  <s:actionerror/>
  <s:fielderror/>
  <s:actionmessage/> 
		  
  <s:form id="dataimportForm" name="dataimportForm" namespace="/dataimport" 
  		  action="dataimport.action" validate="true" method="POST" enctype="multipart/form-data">
  	<s:hidden name="dataimport.id"></s:hidden>
  	
    <table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="sep" ><img src="../images/spacer.gif" style="width:180px;" /></td>
        <td class="sep" ><img src="../images/spacer.gif" style="width:180px;" /></td>
        <td class="sep sep2" ><img src="../images/spacer.gif" /></td>
      </tr>
      <tr>
          <td colspan="2">
        	  <label class="fLabel" >Import Job Name </label>
	          <div class="fField">
	          		<s:textfield name="dataimport.jobName" cssStyle="width:500px" />
	          </div>
          </td>
      </tr>
      <tr>
         <td>
	          <label class="fLabel" >Interface Type</label>
	          <div class="fField">
		            <s:select cssClass="inputSelect" cssStyle="width:255px" name="dataimport.interfaceType" 
		            		  list="getInterfaceTypeList()" listKey="key" listValue="value"
		            		  headerKey="" headerValue="-- Select --">
		            </s:select>
	          </div>
	    </td>
        <td width="255px">
			  <label class="fLabel" >Run At</label>
	          <div class="fField">
					<s:textfield name="runAtDate" cssStyle="" cssClass="inputCalendar" readonly="true" title="%{getRunAtDateTitle()}"/>
			  		<b style="font-weight: normal; " class="weekText">&nbsp;</b>
					<s:select cssClass="inputSelect" cssStyle="vertical-align:middle" name="runAtHour"
							list="dataimportService.hourList" listKey="code" listValue="desc" 
							headerKey="00" headerValue="00">
					</s:select>
              		:
              		<s:select cssClass="inputSelect" cssStyle="vertical-align:middle" name="runAtMin"
							list="dataimportService.minList" listKey="code" listValue="desc" 
							headerKey="00" headerValue="00">
					</s:select>
	          </div>
        </td>
      </tr>
      <tr>
      	<td  colspan="2">
	      	
	      	<div class="fField">Interface File :
			  		<s:file name="dataimport.file" cssStyle="width:400px" cssClass="inputFile"/>
	   	  	</div>
	   	 </td>
   	  </tr>
      <tr>
        <td colspan="2">
        	<label class="fLabel" >Remark </label>
	          <div class="fField">
          	  		<s:textarea name="dataimport.remark" cssStyle="width:500px; height:100px" cssClass="inputTextarea" />
	          </div>
	    </td>
      </tr>
    </table>
	    <div class="btnSet btnSetTypeA">
	      <div class="left" >
	        <div class="button" >
	          <div class="left" >
	            <div class="right" >
	              <input class="inputButton" type="button" id="saveBtn" name="save" value="Save" onclick="clickBtn('dataimport!save.action')"/>
	            </div>
	          </div>
	        </div>
	        <div class="button" >
	          <div class="left" >
	            <div class="right" >
	              <input class="inputButton" type="button" id="cancelBtn" name="cancel" value="Cancel" onclick="window.location='dataimport.action'"/>
	            </div>
	          </div>
	        </div>
	      </div>
	    </div>
   </s:form>
  </div>
  <!-- InstanceEndEditable --> 
  </div>

</body>
</html>